package com.nave.princesslife.baseboard.icons;

import android.graphics.BitmapFactory;
import android.util.Log;
import android.view.MotionEvent;

import com.nave.princesslife.R;
import com.nave.princesslife.activities.MainActivity;
import com.nave.princesslife.main.Game;
import com.nave.princesslife.main.GameObject;

public class Potions extends GameObject {

	private static Potions instance;
	private static boolean touch;

	private Potions() {
	}

	public static Potions getInstance() {
		
		if (instance == null)
			instance = new Potions();
		
		return instance;
	}
	
	public void setup(int w, int h){
		
		// Coletar a imagem na pasta res/drawable
		bitmap = BitmapFactory.decodeResource(Game.getContext_Game().getResources(),
				R.drawable.icon_potions);

		super.setup(w, h, 150f, 500f);

		// Reposicionando
		super.setX((w / 2) - (bitmap.getWidth() / 2));
		super.setY((h - bitmap.getHeight()) - verticalProportion * 30f);
	}
	
	public boolean touchEvent(MotionEvent me, int x, int y) {

		setTouch(super.touchEvent(me, x, y));

		if (isTouch())
			Log.i(MainActivity.TAG, "MiniGame Clicked");

		return true;
	}

	public static boolean isTouch() {
		return touch;
	}

	public static void setTouch(boolean touch) {
		Potions.touch = touch;
	}
}
